﻿<Controls:MetroWindow x:Class="FR.SAFTAnalyser.MainWindowView"
                      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                      xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
                      xmlns:Views="clr-namespace:FR.SAFTAnalyser.Views" 
                      xmlns:meffed="http:\\www.codeplex.com\MEFedMVVM"
                      meffed:ViewModelLocator.ViewModel="MainWindowViewModel"
                      xmlns:tc="clr-namespace:FR.SAFTAnalyser.Controls"
                      xmlns:vc="clr-namespace:FR.SAFTAnalyser.ValueConverters"
                      Title="SAFT " Icon="Resources/App2.ico" 
                      WindowStyle="None" WindowState="Maximized" WindowStartupLocation="CenterScreen">

    <Controls:MetroWindow.Resources>
        <vc:BoolToVisibilityConverter x:Key="boolToVisConv"/>
    </Controls:MetroWindow.Resources>
    
    <Controls:MetroWindow.WindowCommands>
        <Controls:WindowCommands>
            <Button Content="{Binding UserUpdateAction}"
                    Command="{Binding UpdateVersionCommand}"
                    Visibility="{Binding IsUpdateAvailable, Converter={StaticResource boolToVisConv}, ConverterParameter=True}"/>
            <Button Content="opções" Command="{Binding SettingsCommand}"/>
            <Button Content="sobre" Command="{Binding AboutCommand}"/>
        </Controls:WindowCommands>
    </Controls:MetroWindow.WindowCommands>
    
    <DockPanel>
        <StatusBar Height="23" DockPanel.Dock="Bottom" Background="{StaticResource BackgroundSelected}">
            <StatusBarItem>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Margin="5,0,0,0" Foreground="{StaticResource Foreground}"
                               Text="{Binding MensagemStatus}"/>
                    <TextBlock Margin="5,0,0,0" Foreground="{StaticResource Foreground}"
                               Text="{Binding MensagemUpdate}"/>
                </StackPanel>
            </StatusBarItem>
        </StatusBar>
        
        <tc:TabControlEx Margin="5" DockPanel.Dock="Top" IsSynchronizedWithCurrentItem="True"
                         ItemsSource="{Binding Workspaces}"
                         SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}"
                         DisplayMemberPath="DisplayName">
        </tc:TabControlEx>
        
    </DockPanel>
</Controls:MetroWindow>
